﻿@model Order
@{
    ViewBag.Title = "OrderDetail";
}

<h2>Order Information</h2>
<ul>
    <li>Order Id: #@Model.Id</li>
    <li>Customer: @Model.Customer.Fullname</li>
    <li>Order Date: @Model.OrderDate</li>
    <li>Required Date: @Model.RequireDate</li>
    <li>Receiver: @Model.Receiver</li>
    <li>Address: @Model.Address</li>
    <li>Amount: @Model.Amount</li>
    <li>Notes: @Model.Description</li>
</ul>
<fieldset>
    <legend>Order Details</legend>
    <table class="table">
        <tr>
            <th>Product</th>
            <th>Price</th>
            <th>Quantity</th>
            <th>Discount</th>
            <th>Amount</th>
        </tr>
        @foreach (var d in Model.OrderDetails)
        {
        <tr>
            <td>@d.Product.Name</td>
            <td>@d.UnitPrice</td>
            <td>@d.Quantity</td>
            <td>@d.Discount</td>
            <td>@(d.UnitPrice * d.Quantity * (1 - d.Discount))</td>
        </tr>    
        }
    </table>
</fieldset>

